<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="s" uri="http://www.springframework.org/tags" %>
<%@ page isELIgnored="false"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>山西煤炭现货公路交易系统客户端</title>
 <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"/>
    <!-- Bootstrap 3.3.5 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/bootstrap/css/bootstrap.min.css"/>
     <!-- daterange picker -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/daterangepicker/daterangepicker-bs3.css"/>
    <!-- Font Awesome -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/font-awesome/css/font-awesome.min.css"/>
    <!-- Ionicons -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/ionicons/css/ionicons.min.css"/>
    <!-- jvectormap -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/jvectormap/jquery-jvectormap-1.2.2.css"/>
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css"/>
     <!-- DataTables -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.css"/>
    <!-- AdminLTE Skins. Choose a skin from the css/skins
         folder instead of downloading all of them to reduce the load. -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/skins/_all-skins.min.css"/>
	<!-- jQuery 2.1.4 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/jQuery/jQuery-2.1.4.min.js"></script>
	<!-- Bootstrap 3.3.5 -->
    <script src="<s:url value="/resources"/>/adminlte/bootstrap/js/bootstrap.min.js"></script>
	 <!-- AdminLTE App -->
    <script src="<s:url value="/resources"/>/adminlte/dist/js/app.min.js"></script>
    <!-- Select2 -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/plugins/select2/select2.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="<s:url value="/resources"/>/adminlte/dist/css/AdminLTE.min.css">
    <!-- DataTables -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/jquery.dataTables.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/datatables/dataTables.bootstrap.min.js"></script>
    <!-- default -->
     <script src="<s:url value="/resources"/>/adminlte/default.js"></script>
     <!-- 引入 echarts.js -->
    <script src="<s:url value="/resources"/>/echarts/echarts.min.js"></script>
      <script src="<s:url value="/resources"/>/echarts/myechart/addmonthsummaryChart.js"></script>
      <script src="<s:url value="/resources"/>/adminlte/default_logistical.js"></script>
       <!-- Select2 -->
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/select2.full.min.js"></script>
    <script src="<s:url value="/resources"/>/adminlte/plugins/select2/i18n/zh-CN.js"></script>
     <script type="text/javascript">
 $(function(){  
   // loadUserInfo();
      loadMenu("${user.roleType}","${menuid}",${menuList});
      barAndLine("interactive",${xAxis},${xuqcs},${xuqds},${shoulcs},${shoulds},${wanccs},${wancds},${tb},${hb});
      getSelOpts("<s:url value="/"/>/logistical/getSelOpts","selFajs","fajs","faJSum");
      //getExp("dataTab");
      $(".select2").select2();
 });
/*  function getExp(id){
 	 $.post("../export/exportTable.jspx",{},function(data){ 
	    	 alert("2323");
	 });
 	
 } */
 
 //“导出”操作
function getExp(){     
	  window.open('<s:url value="/"/>export/exportTable?xuqcs=${xuqcs}&xuqds=${xuqds}&shoulcs=${shoulcs}&shoulds=${shoulds}&wanccs=${wanccs}&wancds=${wancds}&tabdatejson=${tabdatejson}');
}
 function clickSum(){
		 document.getElementById("form").submit();
 }
     </script>
</head>
<body class="skin-blue sidebar-mini">
<div class="wrapper">
<%@ include file="../../header.jsp" %>
<%@ include file="../../sidebar.jsp" %>
<div class="content-wrapper" >
<!-- <iframe src="mtzq_html/classify1.html" name="main" class="iframe" frameborder="0" id="main" width="100%"  scrolling=no></iframe> -->
        <!-- Content Header (Page header) -->
        <div class="content-header">
          <h1>
           物流分析
            <small>路局发运信息情况汇总
            </small>
          </h1>
          <ol class="breadcrumb">
            <li><a href="<s:url value="/"/>/index.jsp"><i class="fa fa-dashboard"></i>首页</a></li>
            <li><a href="#" id="location1"></a></li>
            <li class="active" id="location2"></li>
          </ol>
        </div>

        <!-- Main content -->
        <div class="content">
          
          
        <div class="box box-success">
                <div class="box-header">
                  <h3 class="box-title">查询条件</h3>
                  <div class="box-tools pull-right">
                  <button  class="btn btn-box-tool" onclick="getExp()"><i class="fa fa-fw fa-download"></i></button>
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
                <input type="hidden" value="${tabDate}" name="list1"/>
              </div>
              </div>
                
                <div class="box-body">
<form action="<s:url value="/"/>/logistical/addMonthSummary" method="post" id="form">
         <input type="hidden" value='${selFajs}' name="selFajs" id ="selFajs"/>
		              	<div class="col-md-4">
		                  <div class="form-group">
		                    <label>选择发局</label>
		                  	<select class="form-control select2" style="width: 100%;"  id="fajs" name="fajs"  data-placeholder="请选择发局" >
		                    </select>
		                  </div><!-- /.form-group -->
		                </div><!-- /.col -->
		                <div class="col-md-4">
		                 <!-- Date range -->
		                  <div class="form-group"  style="padding-top: 25px;">
		                      <button class="btn btn-primary"  type="button" onclick="clickSum()">查询</button>
		                  </div>
		               </div>
		               <div class="col-md-4">
		                 <!-- Date range -->
		                  <div class="form-group">
		                  </div>
		               </div>
		                
		            
		          </form>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
        <div class="box box-success">
                <div class="box-header">
                  <h3 class="box-title">${titleJsp}发运汇总明细表（显示近12个月）</h3>
                  <div class="box-tools pull-right">
                  <button  class="btn btn-box-tool" onclick="getExp()"><i class="fa fa-fw fa-download"></i></button>
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
                <!-- <button class="btn btn-box-tool" data-widget="remove"><i class="fa fa-remove"></i></button> -->
                <input type="hidden" value="${tabDate}" name="list1"/>
              </div>
              </div>
                
                <div class="box-body">
                  <table id="dataTab" class="table table-bordered">
		                  <thead>
		                      <tr>
		                        <th style="text-align: center">年</th>
		                        <c:forEach items="${tabDate}" var="date">
		                        	<th style="text-align: center">${date.nianf}</th>
		                        </c:forEach>
		                      </tr>
		                      <tr>
		                        <th style="text-align: center">月</th>
		                        <c:forEach items="${tabDate}" var="date">
		                        	<th style="text-align: center">${date.yuef}</th>
		                        </c:forEach>
		                      </tr>
		                   </thead>
                    <tbody>
                    	<tr>
                    		<th >需求车数(辆)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.xuqcs}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>需求吨数(万吨)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.xuqds}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>受理车数(辆)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.shoulcs}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>受理吨数(万吨)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.shoulds}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>完成车数(辆)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.wanccs}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>完成吨数(万吨)</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
		                       			 <td>${tdata.wancds}</td>
		                        	</c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>完成车数同比</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
	                    				<c:if test="${tdata.tb lt 0}">
	                    		           <td><font color="green">${tdata.tb}%</font></td>
	                    				</c:if>
	                    				<c:if test="${tdata.tb ge 0}">
	                    				  <td><font color="red">${tdata.tb}%</font></td>
	                    				</c:if>
                    		        </c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                    	<tr>
                    		<th>完成车数环比</th>
                    		<c:forEach items="${tabDate}" var="date">
                    			<c:forEach items="${sumList}" var="tdata">
                    				<c:if test="${date.nianf eq tdata.nianf && date.yuef eq tdata.yuef}">
                    					<c:if test="${tdata.hb lt 0}">
	                    		           <td><font color="green">${tdata.hb}%</font></td>
	                    				</c:if>
	                    				<c:if test="${tdata.hb ge 0}">
	                    				  <td><font color="red">${tdata.hb}%</font></td>
	                    				</c:if>
                    		        </c:if>
		                      	</c:forEach>
		                    </c:forEach>
                    	</tr>
                     </tbody>
                  </table>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
          
<!-- 数据图 start-->
        <div class="row">
            <div class="col-xs-12">
             <!-- interactive chart -->
              <div class="box box-primary">
                <div class="box-header with-border">
                  <i class="fa fa-bar-chart-o"></i>
                  <h3 class="box-title">${titleJsp}发运情况汇总明细表（最近12个月）</h3>
                  
                </div>
                <div class="box-body">
                  <div id="interactive" style="height: 300px;"></div>
                </div><!-- /.box-body-->
              </div><!-- /.box -->

            </div><!-- /.col (LEFT) -->
          </div><!-- /.row -->
        </div><!-- /.content -->
      </div><!-- /.content-wrapper -->
</div>  
</body>
</html>
